package cn.gyx.hrm.doc;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

// 指定索引库
@Document(indexName = "gyxtest",type = "course")
@Data
public class CourseDoc {
    // 标记文档id
    @Id
    private  Long id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String name;

   @Field(type =FieldType.Keyword)
    private String gradeName;

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String forUser;

    private Long courseTypeId;

    // 机构名字
    @Field(type =FieldType.Keyword)
    private String tenantName;

    @Field(type =FieldType.Keyword,index = false)
    private String pic;

    private Long tenantId;

    // 销量
    private Integer saleCount;

    // 人气
    private Integer viewCount;

    //评论
    private Integer commentCount;

    private Date onlineTime;

    /**
     * 代表charge
     */
    @Field(type =FieldType.Keyword)
    private String chargeName;

    private Float price;

    private Float priceOld;
}
